/****** Object:  Stored Procedure [dbo].spKhachHangUpdate Script Date: 6/11/2012 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[spKhachHangUpdate]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spKhachHangUpdate]
GO

/******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:					Description:
**		--------	--------				-----------------------------------
**		11/06/2012	SongTM					Innit created
*******************************************************************************/

CREATE PROCEDURE [dbo].[spKhachHangUpdate]
(
	@MaKH nvarchar(6),
	@TenKH nvarchar(50),
	@DiaChi nvarchar(80),
	@TinhThanh nvarchar(25),
	@QuanHuyen nvarchar(25),
	@SoDT nvarchar(15),
	@SoFax nvarchar(15),
	@MaSoThue nvarchar(15),
	@Email nvarchar(30),
	@Website nvarchar(35),
	@GhiChu nvarchar(100)
)

WITH ENCRYPTION

AS

SET NOCOUNT ON

UPDATE [tbl_KhachHang]
SET [TenKH] = @TenKH,
	[DiaChi] = @DiaChi,
	[TinhThanh] = @TinhThanh,
	[QuanHuyen] = @QuanHuyen,
	[SoDT] = @SoDT,
	[SoFax] = @SoFax,
	[MaSoThue] = @MaSoThue,
	[Email] = @Email,
	[Website] = @Website,
	[GhiChu] = @GhiChu
WHERE	[MaKH] = @MaKH
GO

--GRANT EXECUTE ON [dbo].[spKhachHangUpdate] TO [sa]
--GO
